package ch.fusun.baron.printing.service.impl;

import ch.fusun.baron.core.injection.Inject;
import ch.fusun.baron.core.rmi.User;
import ch.fusun.baron.data.DataUpdate;
import ch.fusun.baron.printing.MessagingService;

/**
 *
 */
public class AddMessageDataUpdate implements DataUpdate {

	private User user;
	private String message;
	@Inject
	private transient MessagingService messagingService;

	/**
	 * Kryo
	 */
	public AddMessageDataUpdate() {
	}

	/**
	 * @param user
	 *            The user
	 * @param message
	 *            The message
	 */
	public AddMessageDataUpdate(User user, String message) {
		this.user = user;
		this.message = message;
	}

	@Override
	public void update() {
		messagingService.addMessage(user, message);
	}

}
